package com.hx.company.test;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

import org.junit.Test;


public class test {
	@Test
	public void test1(){
		try {
			FileOutputStream fos=new FileOutputStream("C:/Users/PC/Desktop/a.txt");	
			InputStream in=new FileInputStream("C:/Users/PC/Desktop/aa.jpg");
			byte[] buf=new byte[1024];
			int len=0;
			while((len=in.read(buf))!=-1){
				fos.write(buf, 0, len);
			}
			fos.flush();
			fos.close();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		 
	}

}
